import request from '@/utils/request'
const prefix = '/gift/api/category'

/**
 * 获取分类列表
 * @returns
 */
const getCategoryData = () => {
	return request({
		url: prefix + '/index',
	})
}
/**
 * 获取品牌列表
 * @returns
 */
const getBrandData = (name) => {
	return request({
		url: prefix + '/brandList',
		params: {
			name
		}
	})
}
/**
 * 根据分类id获取商品列表
 */
const getGoodsByCategoryId = (id) => {
	return request({
		url: prefix + '/goodsListByCategoryId/' + id,
	})
}

/**
 * 根据品牌id获取商品列表
 */
const getGoodsByBrandId = (brandId) => {
	return request({
		url: prefix + '/brandGoodsList/' + brandId
	})
}

export default {
	getCategoryData,
	getBrandData,
	getGoodsByCategoryId,
	getGoodsByBrandId
}